package fp.poczadly.client.event;

import com.google.gwt.event.shared.GwtEvent;

public class PrivateMessageEvent extends GwtEvent<PrivateMessageEventHandler>{

	public static Type<PrivateMessageEventHandler> TYPE = new Type<PrivateMessageEventHandler>();
	
	private String username;
	
	public PrivateMessageEvent( String username ) {
		this.username = username;
	}
	
	@Override
	public Type<PrivateMessageEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch( PrivateMessageEventHandler handler ) {
		handler.openPrivateMessageView( this );
	}

	public String getUsername() {
		return username;
	}
	
}
